package com.ruoyi.wechat.service.impl;

import java.util.List;

import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.wechat.mapper.CProjectMapper;
import com.ruoyi.wechat.domain.CProject;
import com.ruoyi.wechat.service.ICProjectService;

/**
 * 营地项目列表Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-03
 */
@Service
public class CProjectServiceImpl implements ICProjectService 
{
    @Autowired
    private CProjectMapper cProjectMapper;

    /**
     * 查询营地项目列表
     * 
     * @param projectId 营地项目列表主键
     * @return 营地项目列表
     */
    @Override
    public CProject selectCProjectByProjectId(String projectId)
    {
        return cProjectMapper.selectCProjectByProjectId(projectId);
    }

    /**
     * 查询营地项目列表列表
     * 
     * @param cProject 营地项目列表
     * @return 营地项目列表
     */
    @Override
    public List<CProject> selectCProjectList(CProject cProject)
    {
        return cProjectMapper.selectCProjectList(cProject);
    }

    /**
     * 新增营地项目列表
     * 
     * @param cProject 营地项目列表
     * @return 结果
     */
    @Override
    public int insertCProject(CProject cProject)
    {
        cProject.setProjectId(IdUtils.randomUUID());
        return cProjectMapper.insertCProject(cProject);
    }

    /**
     * 修改营地项目列表
     * 
     * @param cProject 营地项目列表
     * @return 结果
     */
    @Override
    public int updateCProject(CProject cProject)
    {
        return cProjectMapper.updateCProject(cProject);
    }

    /**
     * 批量删除营地项目列表
     * 
     * @param projectIds 需要删除的营地项目列表主键
     * @return 结果
     */
    @Override
    public int deleteCProjectByProjectIds(String[] projectIds)
    {
        return cProjectMapper.deleteCProjectByProjectIds(projectIds);
    }

    /**
     * 删除营地项目列表信息
     * 
     * @param projectId 营地项目列表主键
     * @return 结果
     */
    @Override
    public int deleteCProjectByProjectId(String projectId)
    {
        return cProjectMapper.deleteCProjectByProjectId(projectId);
    }

    @Override
    public List<CProject> getInfoByCampId(String campId) {
        CProject cProject = new CProject();
        cProject.setCampId(campId);
        return cProjectMapper.selectCProjectList(cProject);
    }
}
